package com.zbkj.admin.controller.merchant;

import com.zbkj.dal.base.result.CommonResult;
import com.zbkj.service.model.front.req.log.ShareOrderLogCreateReq;
import com.zbkj.service.model.front.vo.log.ShareOrderLogVO;
import com.zbkj.service.service.order.ShareOrderOperateLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author wangzhengyan
 * @date 2024/4/6 8:08 PM
 */
@RestController
@Api(tags = "供享订单操作日志相关API")
public class MerchantShareOrderLogController {

    @Resource
    private ShareOrderOperateLogService shareOrderOperateLogService;

    @PostMapping("api/admin/merchant/share/log/new")
    @ApiOperation(value = "新建供享订单操作日志")
    public CommonResult<Boolean> addShareOrder(@RequestBody ShareOrderLogCreateReq req) {
        return CommonResult.success(shareOrderOperateLogService.addLog(req));
    }

    @GetMapping("api/admin/merchant/share/log/list")
    @ApiOperation(value = "获取供享订单操作日志列表")
    public CommonResult<List<ShareOrderLogVO>> getShareOrderLogList(@RequestParam("orderNo") String orderNo) {
        return CommonResult.success(shareOrderOperateLogService.getLogList(orderNo));
    }


}
